﻿<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Luna" 
    xmlns:System="clr-namespace:System;assembly=mscorlib" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:Presentation="clr-namespace:DotBeer.UI.WPFClient"
    xmlns:BusinessComponents="clr-namespace:DotBeer.Business.Components;assembly=DotBeer.Business.Components"
    xmlns:BusinessEntities="clr-namespace:DotBeer.Business.Entities;assembly=DotBeer.Business.Entities"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
	xmlns:Behaviors="clr-namespace:DotBeer.UI.WPFClient.Behaviors"
	x:Class="DotBeer.UI.WPFClient.WindowMain"
	x:Name="WinMain"
    mc:Ignorable="d"
    Presentation:PositionProperties.SavePositionAndState="True"
    Presentation:InputBindingsProperties.UseInputBindingsProperty="True"
	Title="{Binding WindowTitle}"
    FontFamily="./..\Fonts\#Cooper"
    WindowStyle="SingleBorderWindow"
    Icon="/DotBeer.UI.WPFClient;component/Images/icon.ico"
    Closing="WinMain_Closing"
    d:DesignWidth="1142"
    d:DesignHeight="629"
    SnapsToDevicePixels="True">
    <Window.Resources>
        <Presentation:AutoCompleteEntryConverter x:Key="AutoCompleteEntryConverter"/>
        <Presentation:CountConverter x:Key="countConverter"/>
        <Presentation:DateTimeConverter x:Key="DateTimeConverter" />
        <Presentation:CommandReference x:Key="EditBuildCommandReference" Command="{Binding ShowEditWindowCommand}"/>
        <Presentation:CommandReference x:Key="PrintBuildCommandReference" Command="{Binding ShowPrintWindowCommand}"/>
        <Presentation:CommandReference x:Key="ShowOptionsWindowCommandReference" Command="{Binding ShowOptionsWindowCommand}"/>
        <Presentation:CommandReference x:Key="RefreshCommandReference" Command="{Binding RefreshCommand}"/>
        <Storyboard x:Key="ShowHeroesGrid" >
        	<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="HeroesTavernControl" Storyboard.TargetProperty="(FrameworkElement.Margin)">
        		<SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
        	</ThicknessAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="HideHeroesGrid">
        	<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="HeroesTavernControl" Storyboard.TargetProperty="(FrameworkElement.Margin)">
        		<SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="0,-565,0,0"/>
        	</ThicknessAnimationUsingKeyFrames>
        </Storyboard>
        <System:Double x:Key="ButtonOptionsHeight">20</System:Double>
        <Storyboard x:Key="ShowMenuGrid" >
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                           Storyboard.Target="{Binding ElementName=BorderMenu}" 
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                <SplineDoubleKeyFrame KeySpline="0,0,0,1" KeyTime="00:00:00.5000000" Value="-214"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="HideMenuGrid" >
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                           Storyboard.TargetName="BorderMenu" 
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <System:Double x:Key="ButtonOptionsWidth">100</System:Double>
        <Thickness x:Key="ButtonOptionsMargin">2,5,2,5</Thickness>
    </Window.Resources>
    <Window.Triggers>
        <EventTrigger RoutedEvent="UIElement.MouseLeftButtonUp" SourceName="HeroesTavernControl">
            <BeginStoryboard Storyboard="{StaticResource HideHeroesGrid}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="Presentation:HeroesTavernControl.SelectedHeroChanged" SourceName="HeroesTavernControl">
            <BeginStoryboard Storyboard="{StaticResource HideHeroesGrid}"/>
        </EventTrigger>
    </Window.Triggers>
    <Grid x:Name="LayoutRoot" Width="Auto" Height="Auto" 
          Background="{DynamicResource BrushWindowBackground}">
        <Grid.RowDefinitions>
            <RowDefinition Height="120"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="233"/>
        </Grid.ColumnDefinitions>
        <Presentation:ViewModelChangeDispatcher Source="{Binding MenuExpanded, Mode=OneWay}"
                                                Value="True"
                                                FirstStoryboard="{StaticResource ShowMenuGrid}" />
        <Presentation:ViewModelChangeDispatcher Source="{Binding MenuExpanded, Mode=OneWay}"
                                                Value="False"
                                                FirstStoryboard="{StaticResource HideMenuGrid}" />
        <Presentation:ViewModelChangeDispatcher Source="{Binding SelectedSideState, Mode=OneWay}"
                                                Value="Changing"
                                                FirstStoryboard="{StaticResource HideHeroesGrid}"
                                                FirstCommand="{Binding CompleteChangeSideCommand}"
                                                SecondStoryboard="{StaticResource ShowHeroesGrid}"/>
        <Presentation:ViewModelStyleSelector Source="{Binding Hero.Side, Mode=OneWay}"
                                             Value="Sentinel"
                                             TargetElement="{Binding ElementName=ButtCircleSentinel}"
                                             DefaultStyle="{StaticResource ButtonCircleStyle}"
                                             HighlightedStyle="{StaticResource ButtonCircleSelectedStyle}"/>
        <Presentation:ViewModelStyleSelector Source="{Binding Hero.Side, Mode=OneWay}"
                                             Value="Scourge"
                                             TargetElement="{Binding ElementName=ButtCircleScourge}"
                                             DefaultStyle="{StaticResource ButtonCircleStyle}"
                                             HighlightedStyle="{StaticResource ButtonCircleSelectedStyle}"/>
        <Presentation:ViewModelStyleSelector Source="{Binding Hero.Side, Mode=OneWay}"
                                             Value="Neutral"
                                             TargetElement="{Binding ElementName=ButtCircleNeutral}"
                                             DefaultStyle="{StaticResource ButtonCircleStyle}"
                                             HighlightedStyle="{StaticResource ButtonCircleSelectedStyle}"/>
        <Presentation:AutoCompleteControl x:Name="AutoCompleteControl" 
                                          TargetControl="{Binding ElementName=textBoxHeroNameSearch}"
                                          IsPopupOpen="{Binding IsActive, ElementName=WinMain}"
                                          Items="{Binding Heroes, Converter={StaticResource AutoCompleteEntryConverter}}"
                                          MinimumProvidedCharacters="3" d:IsHidden="True" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="33" Height="15"/>
        <Rectangle Fill="{x:Null}" Stroke="{DynamicResource ImpassiveColor4}" StrokeThickness="3" HorizontalAlignment="Left" Margin="10,19,0,0" VerticalAlignment="Top" Width="64" Height="64" x:Name="RectangleHeroImage"/>
        <TextBlock HorizontalAlignment="Stretch" Margin="83,14,175,0" x:Name="TextBlockHeroName" VerticalAlignment="Top" Height="30" FontSize="24" TextWrapping="Wrap" Foreground="#FF000000" Text="{Binding Hero.Name}" d:LayoutOverrides="VerticalAlignment"/>
        <Image Height="64" HorizontalAlignment="Left" Margin="10,19,0,0" x:Name="ImageHero" Stretch="Fill" VerticalAlignment="Top" Width="64" Source="{Binding Hero.ImagePath}" />
        <ComboBox x:Name="ComboBoxAuthor"
                  Height="{DynamicResource ComboBoxHeight}" 
                  Margin="161,64.337,0,0"
                  VerticalAlignment="Top" 
                  HorizontalAlignment="Left" 
                  Width="150" 
                  ItemsSource="{Binding Authors, Mode=OneWay}" 
                  SelectedItem="{Binding Path=AuthorName}"
				  Style="{DynamicResource ComboBoxBuildStyle}"
                  Tag="{Binding Path=Authors.Count, Converter={StaticResource countConverter}}" 
                  Presentation:CommandProperties.Command="{Binding LoadHeroByAuthorNameCommand}"
                  Presentation:ComboBoxProperties.ExecuteCommandAfterDropDownClosed="True">
        </ComboBox>
        <TextBlock HorizontalAlignment="Left" x:Name="TextBlockAuthorName" Text="Author" TextWrapping="Wrap" Margin="83,66.737,0,0" FontSize="{DynamicResource FontSizeNormal}" Foreground="#FF000000" VerticalAlignment="Top"/>
        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Grid.Row="1" Grid.ColumnSpan="2" d:LayoutOverrides="GridBox">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.444*"/>
                <ColumnDefinition Width="42"/>
                <ColumnDefinition Width="0.296*"/>
                <ColumnDefinition Width="42"/>
                <ColumnDefinition Width="0.26*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <ListView Margin="10,10,10,10" 
                      IsSynchronizedWithCurrentItem="True" 
                      x:Name="ListViewSkill"
				      ItemsSource="{Binding Hero.CurrentSkills}" 
				      HorizontalContentAlignment="Left" 
				      VerticalContentAlignment="Top"
				      ScrollViewer.HorizontalScrollBarVisibility="Auto" 
				      ScrollViewer.VerticalScrollBarVisibility="Auto" 
				      RenderTransformOrigin="0.5,0.5" 
                      Grid.Row="1" 
                      Grid.Column="2" 
                      Style="{DynamicResource ListViewStyle}" 
                      Grid.ColumnSpan="2"
                      Presentation:SelectorProperties.ScrollToFirstItemOnItemsCollectionChanged="True">
                <ListView.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                        <SkewTransform AngleX="0" AngleY="0"/>
                        <RotateTransform Angle="0"/>
                        <TranslateTransform X="0" Y="0"/>
                    </TransformGroup>
                </ListView.RenderTransform>
                <ListView.View>
                    <GridView>
                        <GridViewColumn Header="Level">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Border BorderThickness="0,0,3,0"
										Padding="0,0,0,0">
                                        <TextBlock Text="{Binding Level}" 
											VerticalAlignment="Center" HorizontalAlignment="Left" Padding="0,0,0,0"/>
                                    </Border>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn  Header="Name">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Border BorderThickness="0,0,3,0"
										Padding="0,0,0,0">
                                        <TextBlock Text="{Binding Name}" 
											VerticalAlignment="Center" HorizontalAlignment="Left" Padding="0,0,0,0"/>
                                    </Border>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                    </GridView>
                </ListView.View>
            </ListView>
            <ComboBox Height="{DynamicResource ComboBoxHeight}" 
                      IsSynchronizedWithCurrentItem="True" 
                      x:Name="ComboBoxSkillBuildsNames" 
                      ItemsSource="{Binding Hero.SkillBuildsNames}" 
                      SelectedValue="{Binding Hero.CurrentSkillBuildName}" 
                      Style="{DynamicResource ComboBoxBuildStyle}" 
                      Grid.Column="2" 
                      HorizontalAlignment="Right" 
                      Width="{DynamicResource ComboBoxBuildWidth}" 
                      ItemContainerStyle="{DynamicResource ComboBoxItemStyle}" 
                      VerticalAlignment="Center" 
                      Margin="0,0,5,0" 
                      Tag="{Binding Hero.SkillBuilds.Count, Converter={StaticResource countConverter}}" >
            </ComboBox>
            <ListView Margin="10,10,10,10" 
                      IsSynchronizedWithCurrentItem="True" 
                      x:Name="ListViewItem" 
				      ScrollViewer.VerticalScrollBarVisibility="Auto" 
				      ItemsSource="{Binding FilteredCurrentItems}" 
                      RenderTransformOrigin="0.5,0.5" 
                      Grid.Row="1" 
                      BorderBrush="{DynamicResource ImpassiveColor4}" 
                      BorderThickness="{DynamicResource ThicknessSize_1}" 
                      Style="{DynamicResource ListViewStyle}" 
                      Grid.ColumnSpan="2"
                      TabIndex="0"
                      Presentation:SelectorProperties.ScrollToFirstItemOnItemsCollectionChanged="True">
                <ListView.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA7BAA0" Offset="0"/>
                        <GradientStop Color="#FFD0DECB" Offset="1"/>
                    </LinearGradientBrush>
                </ListView.Background>
                <ListView.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                        <SkewTransform AngleX="0" AngleY="0"/>
                        <RotateTransform Angle="0"/>
                        <TranslateTransform X="0" Y="0"/>
                    </TransformGroup>
                </ListView.RenderTransform>
                <ListView.View>
                    <GridView>
                        <GridViewColumn Header="Name">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Border BorderThickness="0,0,3,0"
										Padding="0,0,0,0" VerticalAlignment="Center">
                                        <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
                                            <Image Source="{Binding ImagePath}"
												Width="30" Height="30" Margin="0,0,0,0" VerticalAlignment="Center"/>
                                            <TextBlock Text="{Binding Name}" 
												VerticalAlignment="Center" Padding="5,0,0,0"/>
                                        </StackPanel>
                                    </Border>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="Total Cost">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Border BorderThickness="0,0,3,0"
										Padding="0,0,0,0">
                                        <TextBlock Text="{Binding TotalCost}" 
											VerticalAlignment="Center" HorizontalAlignment="Left" Padding="0,0,0,0"/>
                                    </Border>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="Recipe Cost">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Border BorderThickness="0,0,3,0"
										Padding="0,0,0,0">
                                        <TextBlock Text="{Binding RecipeCost}" 
											VerticalAlignment="Center" HorizontalAlignment="Left" Padding="0,0,0,0"/>
                                    </Border>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="Type">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Border BorderThickness="0,0,3,0"
										Padding="0,0,0,0">
                                        <TextBlock Text="{Binding Type}" 
											VerticalAlignment="Center" HorizontalAlignment="Left" Padding="0,0,0,0"/>
                                    </Border>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="Comment">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Border BorderThickness="0,0,3,0"
										Padding="0,0,0,0">
                                        <TextBlock Text="{Binding Comment}" 
											VerticalAlignment="Center" HorizontalAlignment="Left" Padding="0,0,0,0"/>
                                    </Border>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                    </GridView>
                </ListView.View>
            </ListView>
            <ComboBox Height="{DynamicResource ComboBoxHeight}" 
                      IsSynchronizedWithCurrentItem="True" 
                      x:Name="ComboBoxItemBuildsNames" 
                      ItemsSource="{Binding Hero.ItemBuildsNames}" 
                      SelectedValue="{Binding Hero.CurrentItemBuildName}" 
                      Style="{DynamicResource ComboBoxBuildStyle}" 
                      Width="{DynamicResource ComboBoxBuildWidth}" 
                      ItemContainerStyle="{DynamicResource ComboBoxItemStyle}" 
                      Grid.Column="0" 
                      HorizontalAlignment="Right" 
                      VerticalAlignment="Center" 
                      Margin="0,0,5,0" Tag="{Binding Hero.ItemBuilds.Count, Converter={StaticResource countConverter}}" >
            </ComboBox>
            <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Text="Skill Build" TextWrapping="Wrap" x:Name="TextBlockSkillBuild" Grid.Column="2" Margin="10,0,0,0" FontSize="{DynamicResource FontSizeNormal}" Foreground="#FF000000"/>
            <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Text="Item Build" TextWrapping="Wrap" x:Name="TextBlockItemBuild" Margin="10,0,0,0" Foreground="#FF000000" FontSize="{DynamicResource FontSizeNormal}" FontWeight="Normal"/>
            <Grid Grid.Column="4" Grid.RowSpan="2">
            	<Grid.ColumnDefinitions>
            		<ColumnDefinition/>
            	</Grid.ColumnDefinitions>
            	<Grid.RowDefinitions>
            		<RowDefinition Height="40"/>
            		<RowDefinition Height="40"/>
            		<RowDefinition Height="40"/>
            		<RowDefinition Height="0.786*"/>
            	</Grid.RowDefinitions>
            	<TextBlock x:Name="TextBlockLastUpdateDate" 
                           Text="{Binding Hero.LastUpdateDate, StringFormat=Last update: \{0\}, TargetNullValue=Last update:, Converter={StaticResource DateTimeConverter}}" 
                           TextWrapping="Wrap" 
                           FontSize="{DynamicResource FontSizeNormal}" 
                           Foreground="#FF000000" 
                           VerticalAlignment="Center" HorizontalAlignment="Left"/>
            	<TextBlock VerticalAlignment="Center" Text="Comments" TextWrapping="Wrap" x:Name="TextBlockComments" Foreground="#FF000000" FontSize="{DynamicResource FontSizeNormal}" Grid.Row="2" d:LayoutOverrides="HorizontalAlignment, GridBox" HorizontalAlignment="Left"/>
            	<TextBox HorizontalAlignment="Stretch" 
            		     Style="{DynamicResource TextBoxStyle}" 
            		     VerticalAlignment="Stretch" 
            		     Text="{Binding Hero.Comments}" 
            		     TextWrapping="Wrap" 
            		     Margin="0,0,10,10" 
            		     IsReadOnly="True" 
            		     AcceptsReturn="True"
            		     VerticalScrollBarVisibility="Auto" Grid.Row="3"/>
            	<TextBlock x:Name="TextBlockDotaVersion" Text="{Binding Hero.DotaVersion, StringFormat=DotA version: \{0\}, TargetNullValue=DotA version:}" TextWrapping="Wrap" FontSize="{DynamicResource FontSizeNormal}" Foreground="#FF000000" VerticalAlignment="Center" Margin="0" Grid.Row="1" HorizontalAlignment="Left"/>
            </Grid>
            <Button HorizontalAlignment="Right" VerticalAlignment="Center" Content="+" Width="24" Height="23.999" Style="{DynamicResource ButtonLightStyle}" FontSize="20" FontWeight="Bold" Grid.Column="1" Margin="0,0,10,0" x:Name="ButtonCopyItemBuild" Command="{Binding CopyItemBuildCommand}" ToolTip="Copy item build to clipboard" />
            <Button Content="+" Style="{DynamicResource ButtonLightStyle}" FontSize="20" FontWeight="Bold" Grid.Column="3" HorizontalAlignment="Right" VerticalAlignment="Center" Height="24" Width="24" Margin="0,0,10,0" x:Name="ButtonCopySkillBuild" Command="{Binding CopySkillBuildCommand}" ToolTip="Copy skill build to clipboard" />
            <Expander Grid.Row="0"
                      Grid.Column="0" 
                      IsExpanded="False" 
                      Header="Display type" 
                      Style="{DynamicResource ExpanderStyle}" 
                      VerticalAlignment="Top" 
                      Margin="0,8,190,0" Grid.RowSpan="2" HorizontalAlignment="Right" Width="120">
                <Border Background="{DynamicResource BrushControlBackgroundLight}" 
                        BorderBrush="{DynamicResource ImpassiveColor4}" 
                        BorderThickness="{DynamicResource ThicknessSize_1}" 
                        CornerRadius="{DynamicResource CornerRadiusSmall}">
                    <Presentation:DisplayControl Width="Auto" Height="Auto"/>
                </Border>
            </Expander>
        </Grid>
        <Grid HorizontalAlignment="Stretch" Width="Auto" Grid.Column="1" VerticalAlignment="Top" Height="110">
            <Border x:Name="BorderMenu"
                    Background="{DynamicResource BrushControlBackgroundLight}" 
                    BorderBrush="{DynamicResource ImpassiveColor4}" 
                    CornerRadius="0,0,0,3" 
                    RenderTransformOrigin="0.5,0.5" 
                    BorderThickness="1,0,1,1" 
                    Margin="0,0,-109,0">
                <Border.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                        <SkewTransform AngleX="0" AngleY="0"/>
                        <RotateTransform Angle="0"/>
                        <TranslateTransform X="{Binding InitialMenuXPosition, Mode=OneTime}" Y="0"/>
                    </TransformGroup>
                </Border.RenderTransform>
                <Grid Margin="0,0,0,0">
                    <WrapPanel Margin="3,0,122,8">
                        <Button Content="Edit Build" Style="{DynamicResource ButtonLightStyle}" x:Name="ButtonEdit" Height="{DynamicResource ButtonOptionsHeight}" Width="{DynamicResource ButtonOptionsWidth}" Margin="{DynamicResource ButtonOptionsMargin}" Command="{Binding ShowEditWindowCommand}"/>
                        <Button Content="Options" Style="{DynamicResource ButtonLightStyle}" x:Name="ButtonOptions" Height="{DynamicResource ButtonOptionsHeight}" Width="{DynamicResource ButtonOptionsWidth}" Margin="{DynamicResource ButtonOptionsMargin}" Command="{Binding ShowOptionsWindowCommand}"/>
                        <Button Content="Print Build" Style="{DynamicResource ButtonLightStyle}" x:Name="ButtonPrint" Height="{DynamicResource ButtonOptionsHeight}" Width="{DynamicResource ButtonOptionsWidth}" Margin="{DynamicResource ButtonOptionsMargin}" Command="{Binding ShowPrintWindowCommand}"/>
                        <Button Content="About" Style="{DynamicResource ButtonLightStyle}" x:Name="ButtonAbout" Height="{DynamicResource ButtonOptionsHeight}" Width="{DynamicResource ButtonOptionsWidth}" Margin="{DynamicResource ButtonOptionsMargin}" Command="{Binding ShowAboutWindowCommand}"/>
                        <Presentation:WatermarkTextBox x:Name="textBoxHeroNameSearch" 
                                                       WatermarkText="Enter the name of the hero" 
                                                       Style="{DynamicResource WatermarkTextBoxStyle}" 
                                                       Width="204"
                                                       Margin="{DynamicResource ButtonOptionsMargin}" 
                                                       Height="20"
                                                       Presentation:CommandProperties.Command="{Binding LoadHeroBySearchHeroNameCommand}"
                                                       Presentation:UpdaterProperties.UpdateSourceOnKey="Enter">
                        	<Binding Path="SearchHeroName" 
                        		     UpdateSourceTrigger="Explicit" 
                        		     Mode="TwoWay" 
                        		     NotifyOnValidationError="True" 
                        		     FallbackValue="Enter the name of the hero">
                        		<Binding.ValidationRules>
                        			<Presentation:HeroNameValidation />
                        		</Binding.ValidationRules>
                        	</Binding>
                        </Presentation:WatermarkTextBox>
                    </WrapPanel>
                    <Button x:Name="ButtonTriangle" 
                            HorizontalAlignment="Left" 
                            Margin="3.5,0,0,3.351" 
                            Style="{DynamicResource ButtonTriangle}" 
                            VerticalAlignment="Bottom" 
                            Width="14.528" 
                            Height="13.499" 
                            Command="{Binding HideOrShowMenuCommand}" 
                            FocusVisualStyle="{x:Null}"/>
                </Grid>
            </Border>
            <Border Background="{DynamicResource BrushControlBackgroundLight}" BorderBrush="{DynamicResource ImpassiveColor4}" BorderThickness="1,0,0,1" CornerRadius="0,0,0,50">
                <Grid Width="Auto" Height="Auto">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="21"/>
                        <ColumnDefinition Width="70"/>
                        <ColumnDefinition Width="70"/>
                        <ColumnDefinition Width="70"/>
                    </Grid.ColumnDefinitions>
                    <Button x:Name="ButtCircleSentinel"
                            Command="{Binding ChangeSideCommand}"
                            CommandParameter="Sentinel"
                            RenderTransformOrigin="0.42,0.411"
                            BorderThickness="0,5,0,5" 
                            HorizontalAlignment="Center" 
                            Style="{DynamicResource ButtonCircleStyle}" 
                            VerticalAlignment="Center" 
                            FocusVisualStyle="{x:Null}" 
                            Grid.ColumnSpan="1"
                            Grid.Column="1">
                        <Button.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform ScaleX="1" ScaleY="1"/>
                                <SkewTransform AngleX="0" AngleY="0"/>
                                <RotateTransform Angle="0"/>
                                <TranslateTransform X="0" Y="0"/>
                            </TransformGroup>
                        </Button.RenderTransform>
                        <Canvas Width="56.146" Height="100">
                            <Image Width="56.146148" Height="100" Source="..\Images\Logos\Sentinel.png" Stretch="Uniform" Canvas.Left="3"/>
                        </Canvas>
                    </Button>
                    <Button x:Name="ButtCircleScourge" 
                            Command="{Binding ChangeSideCommand}"
                            CommandParameter="Scourge" 
                            Style="{DynamicResource ButtonCircleStyle}" 
                            RenderTransformOrigin="0.5,0.5" 
                            HorizontalAlignment="Center" 
                            VerticalAlignment="Center" 
                            Grid.Column="3" 
                            FocusVisualStyle="{x:Null}">
                        <Button.Background>
                            <RadialGradientBrush>
                                <GradientStop Color="#FF566A6A" Offset="0"/>
                                <GradientStop Color="#FF566A6A" Offset="1"/>
                            </RadialGradientBrush>
                        </Button.Background>
                        <Button.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform ScaleX="1" ScaleY="1"/>
                                <SkewTransform AngleX="0" AngleY="0"/>
                                <RotateTransform Angle="180"/>
                                <TranslateTransform X="0" Y="0"/>
                            </TransformGroup>
                        </Button.RenderTransform>
                        <Canvas Width="57.996" Height="100">
                            <Image Width="57.995852" Height="100" RenderTransformOrigin="0.5,0.5" Source="..\Images\Logos\Scourge.png" Stretch="Uniform" Canvas.Top="-7.918" Canvas.Left="2">
                                <Image.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="1" ScaleY="-1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="0"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Image.RenderTransform>
                            </Image>
                        </Canvas>
                    </Button>
                    <Button x:Name="ButtCircleNeutral"
                            Command="{Binding ChangeSideCommand}"
                            CommandParameter="Neutral"
                            HorizontalAlignment="Center" 
                            VerticalAlignment="Center" 
                            Style="{DynamicResource ButtonCircleStyle}" 
                            d:LayoutOverrides="GridBox" 
                            Grid.Column="2" 
                            FocusVisualStyle="{x:Null}">
                        <Canvas Width="57.996" Height="100" RenderTransformOrigin="0.5,0.5">
                            <Canvas.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="0"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Canvas.RenderTransform>
                            <Image Width="56.09" Height="68.284" Source="..\Images\Logos\neutral.png" Stretch="Uniform" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" HorizontalAlignment="Center" Canvas.Top="20">
                                <Image.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="0"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Image.RenderTransform>
                            </Image>
                        </Canvas>
                    </Button>
                </Grid>
            </Border>
        </Grid>
        <Presentation:HeroesTavernControl x:Name="HeroesTavernControl"
                                          SelectedSide="{Binding Path=SelectedSide, Mode=OneWay}"
                                          Presentation:CommandProperties.Command="{Binding LoadHeroByHeroNameCommand}" 
                                          Grid.RowSpan="2" 
                                          Grid.ColumnSpan="2" 
                                          HorizontalAlignment="Center" 
                                          Margin="0,-565,0,0"/>
        <Presentation:UpdateControl x:Name="UpdateControl"
        	                        HorizontalAlignment="Right"
        	                        VerticalAlignment="Bottom"
        	                        Margin="0,0,10,10"
        	                        CheckUpdatesAtLoaded="True" 
                                    ShowDropShadow="True"
                                    ShowConnectingMessage="False"
                                    d:LayoutOverrides="GridBox" 
                                    Grid.Row="1" 
                                    Grid.ColumnSpan="2"/>
    </Grid>
</Window>